package com.dragon.modules.yuegou.service.member;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.modules.yuegou.entity.member.DistrictMemberEntity;
import com.dragon.modules.yuegou.enums.points.DetailSource;
import com.dragon.modules.yuegou.enums.points.DetailType;
import com.dragon.modules.yuegou.model.member.DistrictMember;
import com.dragon.modules.yuegou.model.member.Level;
import com.dragon.modules.yuegou.model.order.Order;

/**
 * 商圈会员 服务接口
 *
 * @author pbuilder generated
 * @date 2019-03-19 08:59:40
 * @version 2.0
 */
public interface DistrictMemberService extends IService<DistrictMemberEntity> {

	/**
	 * 判断商圈会员是否存在，存在返回对象，不存在创建对象，并返回对象
	 * @param memberId
	 * @param busdId
	 */
	DistrictMember createDistrictMember(String memberId, String busdId);

    /**
     * 积分支付
     * @param order
     */
    void pointOrder(Order order, DetailSource source);

    void cancelOrder(Order order);

    /**
     * 更新商圈用户关系表的积分和累计积分
     * @param busdId
     * @param memberId
     */
    Boolean modifyDistrictMemberPoints(String busdId, String memberId, String merchantId, Integer points, DetailType detailType, DetailSource detailSource);

    /**
     * 根据会员id 商圈id查询会员等级id
     * @param memberId
     * @param busdId
     */
    String getMemberLevelId(String memberId,String busdId);

    /**
     * 根据会员id 商圈id查询会员等级
     * @param memberId
     * @param busdId
     */
    Level getMemberLevel(String memberId, String busdId);


    /**
     * 整理会员积分任务
     */
    void neatenMemberPointsTask();

    /**
     * 修改
     * @param busdId
     * @param buyerId
     */
    void changePoints(String busdId, String buyerId,Integer integral);
}